package com.zhangwei.yueshijia.api;

import com.zhangwei.yueshijia.bean.BaseBean;
import com.zhangwei.yueshijia.bean.home.HomeData;
import com.zhangwei.yueshijia.bean.special.VirtualData;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * 质量压缩   主要用于上传
 * 二次采样   对图片显示的处理
 * LruChache
 * 框架  fresco  glide
 * http://10.0.158.139:8080/api/v1.0/account/image
 * 参数一  用户id
 * 参数二   File  file
 */
public interface ApiService {
    public String url = "http://10.0.158.139:8080/api/v1.0/";

    @GET("/")
    Observable<BaseBean<HomeData>> getHomeData(@QueryMap Map<String, String> prams);

    @GET("/")
    Observable<ResponseBody> getgoodSpecial(@QueryMap Map<String, String> prams);

    @GET("/")
    Observable<BaseBean<VirtualData>> getSpecialProgramaData(@QueryMap Map<String, String> prams);

    @Multipart
    @POST("account/image")
    Observable<ResponseBody> uploadImage(@Part("uid") RequestBody uid, @Part MultipartBody.Part part);
}
